package com.ms.mcv.login.controller;

import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Random;

@Controller
@Slf4j
@RequestMapping("/api/account")
public class AccountController {

    @RequestMapping("/sms")
    @ResponseBody
    public String smsCaptcha() {
        Random random = new Random();
        int num = random.nextInt(89999) + 10000;
        JSONObject data = new JSONObject();
        data.put("captcha", num);

        JSONObject response = new JSONObject();
        response.put("result", data);
        return response.toString();
    }
}
